# Makefile for building on Mac OS X using gcc
#
# Assumes the OpenCV framework is installed. 
# http://vislab.cs.vt.edu/~vislab/wiki/images/4/44/OpenCV2.0.dmg
# 

# Indicates compilator to use
CC      = g++

# Specifies compilator options
# Added -I<path> flag
# Removed -framework OpenCV
CFLAGS  = -w -O2 -fopenmp -Wall `pkg-config --cflags opencv` -I/opt/local/include
LDFLAGS = -fopenmp
LDLIBS  = `pkg-config --libs opencv`

# Files extensions .cpp, .o
SUFFIXES = .cpp .o 
.SUFFIXES: $(SUFFIXES) .

# Name of the main program
PROG  = surf

# Object files .o necessary to build the main program
OBJS  = fasthessian.o integral.o main.o surf.o utils.o ipoint.o
 
all: $(PROG)

# Compilation and link
$(PROG): $(OBJS)
	$(CC) $(LDFLAGS) -o $(PROG) $(OBJS) $(LDLIBS)


# Added ./src prefix to tell the compiler where
# all te sources are
%.o: $(addprefix ./src/, %.cpp)
	$(CC) $(CFLAGS) -c $< -o $@

clean:	
	-rm -f $(PROG)
	-rm -f *.o
	-rm -f res/*